package com.library.borrow.util;

/**
 * 借阅状态枚举类
 */
public enum BorrowState {

	GETTING_BOOK("取书中", BorrowState.GETTING_BOOK_STATE),
	BORROWING_BOOK_BOOKS("借阅状态", BorrowState.BORROWING_BOOK_STATE),
	RETURNING_BOOK("归还中", BorrowState.RETURNING_BOOK_STATE),
	RETURNED_BOOK("已归还", BorrowState.RETURNED_BOOK_STATE),
	OUTDATE_BOOK("已超期", BorrowState.OUTDATE_BOOK_STATE),
	LOST_BOOK("已丢失", BorrowState.LOST_BOOK_STATE);

	private final static int GETTING_BOOK_STATE = 0;		//取书
	private final static int BORROWING_BOOK_STATE= 1;		//借阅中
	private final static int RETURNING_BOOK_STATE = 2;		//归还中
	private final static int RETURNED_BOOK_STATE = 3;		//已归还
	private final static int OUTDATE_BOOK_STATE = 4;		//已超期
	private final static int LOST_BOOK_STATE = 5;		//已丢失

	private String name;
	private int state;

	BorrowState(String name, int state) {
		this.name = name;
		this.state = state;
	}

	/**
	 * 获取状态类别名称
	 *
	 * @return
	 */
	public String getName() {
        return name;
    }

    /**
     * 获取状态类型
     *
     * @return
     */
    public int getState() {
        return state;
    }
}
